<?php
/**
 * Created by PhpStorm.
 * User: WangXiaoHong
 * Date: 15-9-23
 * Time: 上午10:51
 */
require_once("/var/www/html/new/conf/le.je");
$le        = new go_sql();
$le->connect();
//供应商身份获取他的分销商
$DistorsNames['dTypeName']=$_GET['amid']=='aid'?'分销商':'供应商';
if(($_SESSION['dtype']==0 || $_SESSION['dtype']==1|| $_SESSION['dtype']==6 || $_SESSION['dtype']==7 )&& $_GET['amid']=='mid' ) {
    include '/var/www/html/new/d/getDistors.php';
    $memberID = ($_SESSION['dtype']==6 || $_SESSION['dtype']==7) ? $_SESSION['sid']:$_SESSION['memberID'];
    if($_SESSION['dtype']==7){
        $DistorsNames = getAll($GLOBALS['le'],$memberID);
    }else{
        $DistorsNames = getRetail($GLOBALS['le'],$memberID);
    }
    //TODO::加载会员数据 ---By Cgp
    $memberNames = require '/var/www/html/new/d/module/link_product/Member.cache.php';
    $DistorsNames['1sanke'] = '散客';
}
// 分销商获取供应商
else if(($_SESSION['dtype']==0 || $_SESSION['dtype']==1 ) && $_GET['amid']=='aid') {
    include '/var/www/html/new/d/getDistors.php';
    //TODO::加载会员数据 ---By Cgp
    $memberNames = require '/var/www/html/new/d/module/link_product/Member.cache.php';
    $DistorsNames = getDistors($GLOBALS['le']);
}
echo '<pre>';
print_r($DistorsNames);
echo '</pre>';
echo json_encode($DistorsNames);

exit;